package com.murray.assignment.pojo;

import java.io.Serializable;
import java.util.List;

/**
 * @author Murray
 * @Date 2021/6/9
 * @Time 18:03
 * @Descrition 对应的是数据库中的cart表，也就是购物车表
 */
public class Cart implements Serializable {
    /**
     * 购物车id
     */
    private Integer cartId;

    public Integer getCartId() {
        return cartId;
    }

    public void setCartId(Integer cartId) {
        this.cartId = cartId;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(Integer totalPrice) {
        this.totalPrice = totalPrice;
    }

    public Integer getTotalNum() {
        return totalNum;
    }

    public void setTotalNum(Integer totalNum) {
        this.totalNum = totalNum;
    }

    public Cart() {
    }

    public Cart(Integer cartId, Integer userId, Integer totalPrice, Integer totalNum) {
        this.cartId = cartId;
        this.userId = userId;
        this.totalPrice = totalPrice;
        this.totalNum = totalNum;
    }

    /**
     * 用户id
     */
    private Integer userId;
    /**
     * 全部价格
     */
    private Integer totalPrice;
    /**
     * 全部数量
     */
    private Integer totalNum;

    private List<CartDetails> cartDetailsList;

    @Override
    public String toString() {
        return "Cart{" +
                "cartId=" + cartId +
                ", userId=" + userId +
                ", totalPrice=" + totalPrice +
                ", totalNum=" + totalNum +
                ", cartDetailsList=" + cartDetailsList +
                '}';
    }

    public List<CartDetails> getCartDetailsList() {
        return cartDetailsList;
    }

    public void setCartDetailsList(List<CartDetails> cartDetailsList) {
        this.cartDetailsList = cartDetailsList;
    }

    public Cart(Integer cartId, Integer userId, Integer totalPrice, Integer totalNum, List<CartDetails> cartDetailsList) {
        this.cartId = cartId;
        this.userId = userId;
        this.totalPrice = totalPrice;
        this.totalNum = totalNum;
        this.cartDetailsList = cartDetailsList;
    }
}
